import baostock as bs
import pandas as pd
import matplotlib.pyplot as plt
import sqlite3

conn = sqlite3.connect('./sqldata.db')
cur = conn.cursor()
cur.execute("select name from sqlite_master where name like 't%'")
tables = cur.fetchall()
print(tables)
for tableName in tables:
    cur.execute("select close,pctChg from %s"%tableName)
    data = cur.fetchall()
    df = pd.DataFrame(data,columns=['close','pctChg'])
    print(df['close'].astype('float64').mean())
